{{useCss "app-pages/css/main.scss",(["/main.html","/"]) }}
<div class="go_top_btn" event-click="{{'$Event.top.go_top'}}">
    <i class="icon-angle-up"></i>
</div>
<!-- <div class="localcity">
    <div class="city" event-click="{{'$Event.main.citymenu'}}">
        {{$Cache.main.location_city||"城市"}}
        <i class="icon-angle-down"></i>
        <div class="city_menu {{$Cache.main.citymenu&&'focus'}}">
            <div class="item" event-click="{{'$Event.main.changecity'}}">更换城市</div>
            <div class="item" event-click="{{'$Event.main.cityerror'}}">报告错误</div>
        </div>
    </div>
    <div class="weather">
        {{$Cache.user.localcity.weather.weather}}
        <img bind-src="{{$Cache.user.localcity.weather.weather_pic}}">
        ，
        {{$Cache.user.localcity.weather.temperature}}ºC
    </div>
</div> -->
<div class="imgbox" id="box">
    <mobile_picwall array-data-key="bus_info.config.home_imgs"></mobile_picwall>
</div>

<!-- <div class="logoinfo">
    {{#if bus_info.info.logo_url}}
    <div class="logobox">
        <img bind-src="{{bus_info.info.logo_url}}">
    </div>
    {{/if}}
    <div class="infos {{bus_info.info.logo_url&&'focus'}}">
        <div class="_storename">{{bus_info.info.title}}</div>
    </div>
</div> -->

<!-- <div class="main_menu_box">
    <href to="/goods_list.html?id=3">
        <div class="item">
            <div class="icon-gift"></div>
            最新上架
        </div>
    </href>
    <href to="/classify.html">
        <div class="item">
            <div class="icon-th"></div>
            分类
        </div>
    </href>
    <href to="/tickets.html">
        <div class="item">
            <div class="icon-bookmark-empty"></div>
            优惠券
        </div>
    </href>
    <a>
        <div class="item" event-click="{{'$Event.top.jumpToCart'}}">
            <div class="icon-basket"></div>
            购物车
        </div>
    </a>
    {{#if !loginer}}
    <href to="/sign_in.html">
        <div class="item">
            <div class="icon-user"></div>
            登陆
        </div>
    </href>
    {{/if}}
    {{#if loginer.card_list.length}}
    <href to="/membercircle.html">
        <div class="item">
            <div class="icon-user"></div>
            Vip专场
        </div>
    </href>
    {{/if}}
</div>
 -->


<!-- goods -->
<!-- <div class="_main_goods">
    {{#each $Cache.main.goods_list}}
        {{#> "jewel-mobile-main-goods"}}
    {{/each}}
</div> -->



<!-- {{#if !$Cache.main.loading_tags_completed}}
<div class="icon-spin4 animate-spin">正在加载</div>
{{#else}} -->
<!-- tag goods -->
<!-- {{#each $Cache.main.classify_list}}
    {{#if contents.length}}
    <div class="typetitle">
        <div class="line"></div>
        {{title}}
        <div class="line"></div>
        <href to="/classify_goods_list.html?id={{_id}}" class="tag_more">更多</href>
    </div>
    <div class="_main_goods">
        {{#each contents}}
            {{#> "jewel-mobile-main-goods","$This",4 > $Index}}
        {{/each}}
    </div>
    {{/if}}
{{/each}}
{{/if}} -->

<!-- <div class="_main_bottom">
    <href to="goods_list.html?id=3">点此查看更多商品</href>
</div> -->
{{#if $Cache.main.goods_list_with_page.length}}
<div class="_main_goods">
    {{#each $Cache.main.goods_list_with_page}}
        {{#> "jewel-mobile-main-goods"}}
    {{/each}}
    {{#if $Cache.main.loading_page_goods}}
    <div class="icon-spin4 animate-spin">正在加载</div>
    {{/if}}
</div>
{{/if}}
{{#if $Cache.main.ismore_page_goods}}
    <div id="_main_mark"></div>
{{/if}}

<xmp type="tag" name="mobile_picwall">
    <div class="picwall">
        <div class="carosule">
            <div class="pic-show">
            {{#if ${array-data-key}.length }}
                {{#each ${array-data-key} }}
                <div style="z-index:{{$Parent.length-$Index}}" class="pic">
                    <href target="_blank" bind-to="{{href||'javascript:void 0'}}">
                        <img bind-src="{{img_url}}?imageView/1/w/500/h/200/q/95" />
                    </href>
                </div>
                {{/each}}
            {{#else}}
                <div style="z-index:{{$Parent.length-$Index}}" class="pic">
                    <href target="_blank" bind-to="{{href||'javascript:void 0'}}">
                        <img bind-src="/images/default_bg.jpg" />
                    </href>
                </div>
            {{/if}}
            </div>
        </div>
    </div>
    <script type="text/vm">
        function(vm) {
            var picwall = vm.queryElement({
                className: 'picwall'
            })[0];
            var img = vm.queryElement({
                tagName: "IMG"
            });
            require(["jQuery"], function($) {
                var $picwall = $(picwall);
                var i = 0;
                var w = $picwall.width();
                var h = w * 0.4;
                $picwall.height(h);
                var current_pic;
                var pics = $picwall.find(".pic");
                var len = $(pics).length;
                console.log(len);   
                var timer = setInterval(function _() {
                    $(pics[(i - 1) % len]).stop().fadeOut(1000);
                    $(pics[i % len]).stop().fadeIn(1000);
                    i += 1;
                    return _;
                }(), 5000);
            });
        }
    </script>
</xmp>

<xmp type="template" name="jewel-mobile-main-goods">
    <div class="maingoods">
        <div class="img">
            <href to="goods_details.html?id={{_id}}" class="imgbox">
                <img bind-src="{{preview_img_url}}?imageView/1/h/200/w/200" />
            </href>
        </div>
        <div class="info">
            <div class="intro">
                {{goods_name}}　{{intro}}
            </div>
            <div class="price">￥{{card_cash_map[$Top.loginer.current_card_factory_id]||cash}}</div>
            <!-- <del>{{original_price?"￥"+original_price:""}}</del> -->
        </div>
    </div>
</xmp>
